<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>小米商城商品案例</title>

    <!-- 给案例引入重置样式。-->
    <link rel="stylesheet" href="./reset.css" />
    <style>
      body {
        text-align: center;
      }
      .item {
        display: inline-block;
        width: 234px;
        height: 300px;
        padding: 20px 10px;
        text-align: center;
        background-color: #fff;
        box-sizing: border-box;
      }
      .item:hover {
        box-shadow: 0 2px 20px 5px rgba(0, 0, 0, 0.1);
      }
      .item img {
        width: 160px;
        height: 160px;
      }
      .item .title {
        margin-top: 14px;
      }
      .item .desc {
        color: #999;
        margin-top: 8px;

        /* 单行显示省略号 */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* 省略的意思 */
      }
      .item .price {
        margin-top: 14px;
        font-size: 14px;
      }
      .item .new-price {
        color: #ff6700;
      }
      .item .old-price {
        color: #999;
        text-decoration: line-through;
        margin-left: 5px;
      }
    </style>
  </head>
  <body>
    <a class="item" href="https://www.mi.com/xiaomipad5pro" target="_blank">
      <img src="./xiaomi01.webp" alt="" />
      <h3 class="title">小米平板5 Pro</h3>
      <p class="desc">全新12代英特尔处理器，CNC一体精雕工艺，2.5K 120Hz高清屏，可选MX550独立显卡</p>
      <div class="price">
        <span class="new-price">2399元起</span>
        <span class="old-price">2499元</span>
      </div>
    </a>
  </body>
</html>
